The present invention relates generally to network routers that are coupled with one or more interface device(s). More specifically, the present invention relates to method and apparatus for reactivating an interface device after it has been deactivated.
A conventional router is typically coupled to various interface devices. These interface devices may be any suitable interface device for communicating with the router. By way of examples, the interface devices may include an ethernet interface, a token ring interface, a serial interface, or a high speed FDDI interface. One embodiment of a router that may be employed with the present invention is further described below with reference to FIG. 5.
Additionally, a conventional router typically includes a processor (e.g., a CPU). The processor may be utilized to implement various local processes associated with the router. For example, the processor may be used to implement a scheduler that schedules and implements various local processes on the router. These local processes take the form of various tasks within the router such as manipulating and interpreting data packets that are received and transmitted by the router.
The local processes that are implemented by the router typically include packet processing procedures. For example, security processes may be implemented on received packets to check whether the packet is authorized to access its intended destination. By way of another example, quality of service processes may also be implemented on received packets to determine a priority for each received packet. That is, some packets may be routed immediately while others are held until high priority packets are routed. Additionally, the local processes may implement various network protocols, such as various layer protocols.
The scheduler of the router is also responsible for scheduling the various local processes. For example, the scheduler determines when to execute each of the local processes. The local processes may be scheduled to execute consecutively. Two or more processes may also be executed in parallel.
For various reasons, one or more interface devices that are coupled to the router may have to be deactivated. For example, resources used by the router may have become overloaded. By way of specific example, the processor""s resources may be insufficient to handle all of the local processes that have been scheduled by the scheduler. In other words, the processor may not have enough processing time or memory resources to execute all of the scheduled local processes.
FIG. 1 is a flowchart illustrating a conventional scheduler procedure 100 that invokes a plurality of local processes on a network router. The scheduler procedure 100 is in the form of a continuous loop. After the router is reset or enabled, one or more local processes are invoked in operations 102 through 110. That is, several local processes may be scheduled to occur one after the other. For example, a first process may include receiving a data packet, and a second process may include performing various manipulation or interpretation processes on the received data packet. Alternatively, two or more local processes may be scheduled to execute in parallel.
The local processes include various data manipulation and management tasks. By way of specific example, a process may include performing a security check on a received data packet, determining priority of routing the data packet, implementing various flow based routing procedures, and/or determining where to route the data packet. A local process may implement various network protocols, such as asynchronous transfer mode (ATM), X.25, switched multimegabit data service (SMDS), and SNTP, and internet protocol (IP).
As shown, local process A is invoked in operation 102, and process B is then invoked in operation 104. In other words, the scheduler procedure includes scheduling process A and then process B. Process A is initiated and completed, and then process B is initiated. In this example, process B is then interrupted by the deactivation routine 112. The deactivation routine may be part of another interrupt routine that includes other processing in addition to a deactivation process. Although the deactivation routine is shown as interrupting process B, of course, it may interrupt any local process (e.g., processes A through n). After the deactivation routine is completed, process B is restarted at operation 104.
After process B is completed, any devices that were deactivated by the deactivation routine 112 may be reactivated in a reactivation process 106. In other words, the reactivation process 106 is typically scheduled and initiated by the scheduler. That is, as soon as the scheduler procedure 100 reaches the reactivation process 106, the interface device is immediately enabled.
When the scheduler procedure 100 reaches the reactivation process 106, the interface device is automatically activated without determining whether it is efficient to reactivate the interface device. In sum, the reactivation process 106 is blindly implemented when the scheduler procedure 100 reaches operation 106.
Any number of local processes are invoked before and/or after the reactivation process 106. As shown, after the reactivation process 106 is invoked, a process C is invoked, and then any number of processes are invoked until a last process n is invoked in operation 110. The entire scheduler procedure is then repeated in operations 102 through 110. In such local processes are scheduled and initated (e.g., invoked by the scheduler), and these local processes will include a reactivation process that automatically enables any deactivated interface devices.
Although this conventional reactivation approach works well under certain conditions, it has associated disadvantages. That is, since a deactivated interface device is automatically reactivated when the scheduler procedure 100 reaches the reactivation process 106, the interface device may be reactivated before the router is ready. For example, the router may not have enough resources to handle processes associated with the reactivated interface device. Under these circumstances, the reactivated interface device will probably be immediately deactivated.
In view of the foregoing, there is a need for a reactivation mechanism and technique that more efficiently reactivates an interface device after it has been deactivated Specifically, there is a need for a technique and apparatus for reactivating an interface device after determining whether certain operating conditions are met, such as whether there are enough available resources.
Accordingly, the present invention provides apparatus and methods for activating a deactivated interface device associated with a router. In general terms, the present invention provides systems and methods for determining when to reactivate the interface device based on one or more operating parameters. In other words, the interface device is not reactivated until one or more predetermined conditions are analyzed and met.
In one embodiment, a method for enabling a first one of a plurality of interfaces associated with a router is disclosed. The first interface is enabled when a first predefined operating condition is met. In one specific embodiment, the first predefined operating condition is met when the first interface has been disabled for at least a programmable predefined minimum time. In another embodiment, the first predefined operating condition is met when the first interface device has been disabled for more than a programmable predefined maximum time. In yet another embodiment, the first predefined operating condition is met when a programmable predefined amount of processing resources are available for implementing a plurality of processes on the router. In yet another alternative embodiment, the first predefined operating condition is met when a predefined amount of memory resources are available for implementing a plurality of processes on the router.
In another method aspect, several operating conditions are checked before the interface is reactivated. In this method, it is determined whether the interface has been deactivated for more than a predefined minimum time. If it is determined that the interface has been deactivated for more than the predefined minimum time, it is determined whether the interface has been deactivated for more than a predefined maximum time. The interface is activated if it is determined that the interface has been deactivated for more than a predefined maximum time. If the interface has not been deactivated for more than a predefined maximum time, it is determined whether the processing or memory resources associated with the router are overloaded. The interface device is activated if it is determined that the processing and memory resources are not overloaded.
In an apparatus aspect of the present invention, a router is disclosed. The router includes a plurality of interfaces arranged to control data communication between the router and other network devices, a processing unit arranged to implement processes associated with the router, and a memory device arranged to facilitate the processes of the processing unit. The processing unit itself includes a scheduler for scheduling and executing processes associated with the interface devices, a disabling mechanism that is arranged to disable the first interface device when a first operating condition associated with the router is met, and an enabling mechanism that is arranged to enable the first interface device when a second operating condition associated with the router is met and after the first interface has been disabled by the disabling mechanism.
In another embodiment, an operating system software for use by a processor in directing operation of a router is disclosed. The operating system software includes at least one processor-readable medium and a program mechanism embedded in the at least one processor-readable medium for causing the processor to enable a first one of a plurality of interfaces associated with the router when a first predefined operating condition is met.
The present invention has many advantages. For example, the present invention allows efficient reactivation of disabled interface devices since reactivation is based on whether one or more operating conditions are met. For example, when an interface device is deactivated due to resource overload, it will not be reactivated when resources are still overloaded (unless it is determined that another interface is to be deactivated instead). That is, the interface device is not reactivated and then immediately deactivated as may occur in conventional reactivation procedures. Thus, local processes are not inefficiently interrupted to again deactivate the reactivated interface device. In sum, the interface device is only reactivated after one or more conditions are analyzed and met, which technique results in efficient utilization of processing resources.